package com.ztorn.fiscale.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ztorn.fiscale.mapper.FiscaleTaxInvoiceItemMapper;
import com.ztorn.fiscale.domain.FiscaleTaxInvoiceItem;
import com.ztorn.fiscale.service.IFiscaleTaxInvoiceItemService;

/**
 * 税务发票明细Service业务层处理
 * 
 * @author ztorn
 * @date 2025-09-19
 */
@Service
public class FiscaleTaxInvoiceItemServiceImpl implements IFiscaleTaxInvoiceItemService 
{
    @Autowired
    private FiscaleTaxInvoiceItemMapper fiscaleTaxInvoiceItemMapper;

    /**
     * 查询税务发票明细
     * 
     * @param itemId 税务发票明细ID
     * @return 税务发票明细
     */
    @Override
    public FiscaleTaxInvoiceItem selectFiscaleTaxInvoiceItemById(Long itemId)
    {
        return fiscaleTaxInvoiceItemMapper.selectFiscaleTaxInvoiceItemById(itemId);
    }

    /**
     * 查询税务发票明细列表
     * 
     * @param fiscaleTaxInvoiceItem 税务发票明细
     * @return 税务发票明细
     */
    @Override
    public List<FiscaleTaxInvoiceItem> selectFiscaleTaxInvoiceItemList(FiscaleTaxInvoiceItem fiscaleTaxInvoiceItem)
    {
        return fiscaleTaxInvoiceItemMapper.selectFiscaleTaxInvoiceItemList(fiscaleTaxInvoiceItem);
    }

    /**
     * 根据发票ID查询税务发票明细列表
     * 
     * @param invoiceId 发票ID
     * @return 税务发票明细集合
     */
    @Override
    public List<FiscaleTaxInvoiceItem> selectFiscaleTaxInvoiceItemByInvoiceId(Long invoiceId)
    {
        return fiscaleTaxInvoiceItemMapper.selectFiscaleTaxInvoiceItemByInvoiceId(invoiceId);
    }

    /**
     * 新增税务发票明细
     * 
     * @param fiscaleTaxInvoiceItem 税务发票明细
     * @return 结果
     */
    @Override
    public int insertFiscaleTaxInvoiceItem(FiscaleTaxInvoiceItem fiscaleTaxInvoiceItem)
    {
        return fiscaleTaxInvoiceItemMapper.insertFiscaleTaxInvoiceItem(fiscaleTaxInvoiceItem);
    }

    /**
     * 批量新增税务发票明细
     * 
     * @param fiscaleTaxInvoiceItems 税务发票明细列表
     * @return 结果
     */
    @Override
    public int insertFiscaleTaxInvoiceItems(List<FiscaleTaxInvoiceItem> fiscaleTaxInvoiceItems)
    {
        return fiscaleTaxInvoiceItemMapper.insertFiscaleTaxInvoiceItems(fiscaleTaxInvoiceItems);
    }

    /**
     * 修改税务发票明细
     * 
     * @param fiscaleTaxInvoiceItem 税务发票明细
     * @return 结果
     */
    @Override
    public int updateFiscaleTaxInvoiceItem(FiscaleTaxInvoiceItem fiscaleTaxInvoiceItem)
    {
        return fiscaleTaxInvoiceItemMapper.updateFiscaleTaxInvoiceItem(fiscaleTaxInvoiceItem);
    }

    /**
     * 批量删除税务发票明细
     * 
     * @param itemIds 需要删除的税务发票明细ID
     * @return 结果
     */
    @Override
    public int deleteFiscaleTaxInvoiceItemByIds(Long[] itemIds)
    {
        return fiscaleTaxInvoiceItemMapper.deleteFiscaleTaxInvoiceItemByIds(itemIds);
    }

    /**
     * 根据发票ID删除税务发票明细
     * 
     * @param invoiceId 发票ID
     * @return 结果
     */
    @Override
    public int deleteFiscaleTaxInvoiceItemByInvoiceId(Long invoiceId)
    {
        return fiscaleTaxInvoiceItemMapper.deleteFiscaleTaxInvoiceItemByInvoiceId(invoiceId);
    }

    /**
     * 删除税务发票明细信息
     * 
     * @param itemId 税务发票明细ID
     * @return 结果
     */
    @Override
    public int deleteFiscaleTaxInvoiceItemById(Long itemId)
    {
        return fiscaleTaxInvoiceItemMapper.deleteFiscaleTaxInvoiceItemById(itemId);
    }
}